#include <iostream>
using namespace std;

class MapSite
{
    virtual void Enter() = 0;
};
class Room:public MapSite
{
    virtual void Enter(){
        cout << "Entering room!" << endl;
    }
};
class Door:public MapSite
{
    virtual void Enter(){
        cout << "Entering door!" << endl;
    }
};
class Maze
{
public:
    Maze();
    void AddRoom(Room*){}
    void AddDoor(Door*){}
};
class MazeGame
{
public:
    Maze* CreateMaze(){
        Maze* mz = MakeMaze();
        Room* rm = MakeRoom();
        mz->AddRoom(rm);
        return mz;
    }
    //factory methods
    virtual Maze* MakeMaze()const{
            return new Maze();
    }
    virtual Room* MakeRoom()const{
            return new Room();
    }
};


    
    
    
    
    
    

    
